package com.nancy.java_design.responsibility.demo1;

public class Client {
    public static void main(String[] args) {
        RequestLeave requestLeave = new RequestLeave("Nancy", 7, "Sick leave");

        // 创建责任链
        GroupLeader groupLeader = new GroupLeader();
        Manager manager = new Manager();
        Chairman chairman = new Chairman();

        // 设置责任链的顺序
        groupLeader.setHandler(manager);
        manager.setHandler(chairman);

        // 提交请求
        groupLeader.passRequest(requestLeave);
    }
}
